import 'package:flutter_deer/generated/json/base/json_convert_content.dart';
import 'package:flutter_deer/database/beans/shift/current_shift_entity.dart';
import 'package:flutter_deer/res/constant.dart';

import 'package:sp_util/sp_util.dart';


CurrentShiftEntity $CurrentShiftEntityFromJson(Map<String, dynamic> json) {
  final CurrentShiftEntity currentShiftEntity = CurrentShiftEntity();
  final String? archivePlanId = jsonConvert.convert<String>(json['archivePlanId']);
  if (archivePlanId != null) {
    currentShiftEntity.archivePlanId = archivePlanId;
  }
  final String? createName = jsonConvert.convert<String>(json['createName']);
  if (createName != null) {
    currentShiftEntity.createName = createName;
  }
  final String? createTime = jsonConvert.convert<String>(json['createTime']);
  if (createTime != null) {
    currentShiftEntity.createTime = createTime;
  }
  final String? endTime = jsonConvert.convert<String>(json['endTime']);
  if (endTime != null) {
    currentShiftEntity.endTime = endTime;
  }
  final String? headUser = jsonConvert.convert<String>(json['headUser']);
  if (headUser != null) {
    currentShiftEntity.headUser = headUser;
  }
  final String? headUserName = jsonConvert.convert<String>(json['headUserName']);
  if (headUserName != null) {
    currentShiftEntity.headUserName = headUserName;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    currentShiftEntity.id = id;
  }
  final int? isDeleted = jsonConvert.convert<int>(json['isDeleted']);
  if (isDeleted != null) {
    currentShiftEntity.isDeleted = isDeleted;
  }
  final bool? isErase = jsonConvert.convert<bool>(json['isErase']);
  if (isErase != null) {
    currentShiftEntity.isErase = isErase;
  }
  final String? mchCode = jsonConvert.convert<String>(json['mchCode']);
  if (mchCode != null) {
    currentShiftEntity.mchCode = mchCode;
  }
  final int? mqttSendMsg = jsonConvert.convert<int>(json['mqttSendMsg']);
  if (mqttSendMsg != null) {
    currentShiftEntity.mqttSendMsg = mqttSendMsg;
  }
  final String? startTime = jsonConvert.convert<String>(json['startTime']);
  if (startTime != null) {
    currentShiftEntity.startTime = startTime;
  }
  final String? updateName = jsonConvert.convert<String>(json['updateName']);
  if (updateName != null) {
    currentShiftEntity.updateName = updateName;
  }
  final String? updateTime = jsonConvert.convert<String>(json['updateTime']);
  if (updateTime != null) {
    currentShiftEntity.updateTime = updateTime;
  }
  final String? workCycleCode = jsonConvert.convert<String>(json['workCycleCode']);
  if (workCycleCode != null) {
    currentShiftEntity.workCycleCode = workCycleCode;
  }
  final int? workCycleStatus = jsonConvert.convert<int>(json['workCycleStatus']);
  if (workCycleStatus != null) {
    currentShiftEntity.workCycleStatus = workCycleStatus;
  }
  return currentShiftEntity;
}

Map<String, dynamic> $CurrentShiftEntityToJson(CurrentShiftEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['archivePlanId'] = entity.archivePlanId;
  data['createName'] = entity.createName;
  data['createTime'] = entity.createTime;
  data['endTime'] = entity.endTime;
  data['headUser'] = entity.headUser;
  data['headUserName'] = entity.headUserName;
  data['id'] = entity.id;
  data['isDeleted'] = entity.isDeleted;
  data['isErase'] = entity.isErase;
  data['mchCode'] = entity.mchCode;
  data['mqttSendMsg'] = entity.mqttSendMsg;
  data['startTime'] = entity.startTime;
  data['updateName'] = entity.updateName;
  data['updateTime'] = entity.updateTime;
  data['workCycleCode'] = entity.workCycleCode;
  data['workCycleStatus'] = entity.workCycleStatus;
  return data;
}

extension CurrentShiftEntityExtension on CurrentShiftEntity {
  CurrentShiftEntity copyWith({
    String? archivePlanId,
    String? createName,
    String? createTime,
    String? endTime,
    String? headUser,
    String? headUserName,
    String? id,
    int? isDeleted,
    bool? isErase,
    String? mchCode,
    int? mqttSendMsg,
    String? startTime,
    String? updateName,
    String? updateTime,
    String? workCycleCode,
    int? workCycleStatus,
  }) {
    return CurrentShiftEntity()
      ..archivePlanId = archivePlanId ?? this.archivePlanId
      ..createName = createName ?? this.createName
      ..createTime = createTime ?? this.createTime
      ..endTime = endTime ?? this.endTime
      ..headUser = headUser ?? this.headUser
      ..headUserName = headUserName ?? this.headUserName
      ..id = id ?? this.id
      ..isDeleted = isDeleted ?? this.isDeleted
      ..isErase = isErase ?? this.isErase
      ..mchCode = mchCode ?? this.mchCode
      ..mqttSendMsg = mqttSendMsg ?? this.mqttSendMsg
      ..startTime = startTime ?? this.startTime
      ..updateName = updateName ?? this.updateName
      ..updateTime = updateTime ?? this.updateTime
      ..workCycleCode = workCycleCode ?? this.workCycleCode
      ..workCycleStatus = workCycleStatus ?? this.workCycleStatus;
  }
}